package com.dp.appi.service.impl;

import com.dp.appi.dao.EncyclopediaDao;
import com.dp.appi.service.EncyclopediaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by xiaoji on 2016/4/28.
 */
@Service
public class EncyclopediaServiceImpl implements EncyclopediaService {
    @Autowired
    private EncyclopediaDao encyclopediaDao;

    /**
     * 获取百科分类
     *
     * @return
     */
    @Override
    public List<Map<String, Object>> getCategory() {
        return encyclopediaDao.getCategory();
    }

    /**
     * @param name 百科名称
     * @param s    开始序列
     * @param n    获取条数
     * @return
     */
    @Override
    public List<Map<String, Object>> encyclopediaList(String name,Integer category_id, Integer s, Integer n) {
        return encyclopediaDao.encyclopediaList(name,category_id,s,n);
    }

    /**
     * 获取百科内容
     *
     * @param encyclopedia_id 百科id
     * @return
     */
    @Override
    public Map<String, Object> getEncyclopediaContent(String userId,Long encyclopedia_id) {
        return encyclopediaDao.getEncyclopediaContent(userId,encyclopedia_id);
    }
}
